import { createContext } from 'react';

/** 定义上下文 */
export interface IWorkflowSwitchContext {
  prefixCls: string;
  // updateDispatch: Dispatch<any>;
  openVisible: boolean;
  requestController: string;
  orderType: string;
  category: string;
  businessCategory: string;
  reloadInfoCallback: () => void;
  businessInfoObj: Record<string, any>;
  // pageRouterPathname: string;
  onClose: () => void;
  nodeFlowForm: any;
}

/** 初始化上下文  */
const init_workflowswitch_context: IWorkflowSwitchContext = {
  prefixCls: 'workflow-switchroot-',
  // updateDispatch: () => { },
  openVisible: false,
  onClose: () => {},
  businessInfoObj: {},
  requestController: '',
  orderType: '',
  category: '',
  businessCategory: '',
  reloadInfoCallback: () => {},
  nodeFlowForm: {},
};

/** 创建上下文  */
const WorkflowSwitchContext = createContext(init_workflowswitch_context);

/**
 * 导出上下文
 */
export { WorkflowSwitchContext };
